import Vue from 'vue'
import Router from 'vue-router'
import FAQ from "@/components/FAQ"
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/home',
      name: 'index',
      meta:{
        title:"首页"
      },
      component:()=>import("@/components/index") //相当于component:index
    },
    {
      path: '/course',
      name: 'course',
      meta:{
        title:"课程名称"
      },
      component:()=>import("@/components/course") //相当于component:course
    },
    {
      path: '/about',
      name: 'about',
      meta:{
        title:"关于我们"
      },
      component:()=>import("@/components/about") //相当于component:about
    },
    {
      path: '/login',
      name: 'login',
      meta:{
        title:"登录"
      },
      component:()=>import("@/components/login") //相当于component:login
    },
    {
      path: '/FAQ',
      name: 'FAQ',
      meta:{
        title:"FAQ"
      },
      component: FAQ, //相当于component:FAQ
      children:[
        {
          path:"/Ans/:id",
          component:()=>import("@/components/Ans")
        }
      ]
    },
  ]
})
